Skip to content

Eliminate O(n^2) status removal in DashboardTreeTableModel#316

Open
NicoPiel wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
NicoPiel:fix/dashboard-status-removal
Open

Eliminate O(n^2) status removal in DashboardTreeTableModel#316
NicoPiel wants to merge 1 commit into
OpenIntegrationEngine:mainfrom
NicoPiel:fix/dashboard-status-removal

Conversation

@NicoPiel
Copy link
Copy Markdown
Collaborator

updateChannelNodes called statuses.remove(status) inside a loop over
child nodes. With an ArrayList, each remove is O(n), making the update
O(channels × statuses). Collected matched statuses in a HashSet and
called removeAll once after the loop, reducing to O(n + m).

updateChannelNodes called statuses.remove(status) inside a loop over
child nodes. With an ArrayList, each remove is O(n), making the update
O(channels × statuses). Collected matched statuses in a HashSet and
called removeAll once after the loop, reducing to O(n + m).

Signed-off-by: Nico Piel <nico.piel@hotmail.de>
@github-actions
Copy link
Copy Markdown

Test Results

  111 files  ±0    214 suites  ±0   7m 2s ⏱️ + 1m 18s
  654 tests ±0    654 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 308 runs  ±0  1 308 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit c22b8ba. ± Comparison against base commit 2e0ff41.

@NicoPiel NicoPiel self-assigned this May 27, 2026
@NicoPiel NicoPiel requested review from a team, gibson9583, jonbartels, kayyagari, mgaffigan, pacmano1, ssrowe and tonygermano and removed request for a team May 27, 2026 21:03
@jonbartels
Copy link
Copy Markdown
Contributor

Is there an existing unit test that covers this method?

If no, can you create one?

Copy link
Copy Markdown
Contributor

@mgaffigan mgaffigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, but was this showing up on a profiler? There's going to be a lot of changes if you are not chasing based on actual performance issues.

@jonbartels jonbartels added this to the Next Release milestone May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants